﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace FITHOU
{
    public class ThiTN
    {
        private int _IDTN;
        private string _ID;
        private string _DATL;
        private string _DAD;

        public ThiTN()
        {

        }

        public int IDTN
        {
            get { return _IDTN; }
            set { _IDTN = value; }
        }
        public string ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        public string DATL
        {
            get { return _DATL; }
            set { _DATL = value; }
        }
        public string DAD
        {
            get { return _DAD; }
            set { _DAD = value; }
        }

        public ThiTN(int IDTN, string ID, string DATL, string DAD)
	    {
            this._IDTN = IDTN;
            this.ID = ID;
            this.DATL = DATL;
            this.DAD = DAD;
        }

        public void init(string ID, string DATL, string DAD)
        {
            this._IDTN = 1;
            this._ID = ID;
            this.DATL = DATL;
            this.DAD = DAD;
        }

        public void ThemTN(int IDTN,string ID,string DATL,string DAD)
        {
            this.IDTN = IDTN;
            string s = this.ID;
            string da = this.DATL;
            string daa = this.DAD;
            this.ID = s + "-" + ID;
            this.DATL = da + DATL;
            this.DAD = daa + DAD;
        }
        public int Tong()
        {
            int tong = 0;
            string s = this._ID;
            if (s.Length == 1)
                tong = 1;
            else
            {
                string[] stong = s.Split('-');
                tong = stong.Length;
            }
            return tong;
        }
    }
}
